<template>
    <div class="subpage">
        <div class="banner"></div>
        <div class="subjectinfo">
            <div class="userinfo">
                <ul class="userul">
                    <li>高三年级</li>
                </ul>
                <el-menu
                    default-active="1-1"
                    class="el-menu-vertical-demo"
                    background-color="#ca0000"
                    text-color="#fff"
                    active-text-color="#ca0000">
                    <el-submenu index="1">
                        <template slot="title">
                            <span>{{ sub }}</span>
                        </template>
                        <el-menu-item index="1-1">课程一</el-menu-item>
                        <el-menu-item index="1-2">课程二</el-menu-item>
                        <el-menu-item index="1-3">课程三</el-menu-item>
                    </el-submenu>
                </el-menu>
            </div>
            <div class="subinfo">
                <div class="back">返回上一页 >></div>
                <div class="subbox">
                    <router-link to="/LearnContent/1" tag="li" class="typeitem">
                        <img src="/static/image/ts1.png" class="image"><div class="teacher">预习模式</div>
                    </router-link >
                    <router-link to="/LearnContent/2" tag="li" class="typeitem">
                        <img src="/static/image/ts2.png" class="image"><div class="teacher">专题模式</div>
                    </router-link >
                    <router-link to="/LearnContent/3" tag="li" class="typeitem">
                        <img src="/static/image/ts3.png" class="image"><div class="teacher">复习模式</div>
                    </router-link >
                    <router-link to="/LearnContent/4" tag="li" class="typeitem">
                        <img src="/static/image/ts4.png" class="image"><div class="teacher">题库模式</div>
                    </router-link >
                </div>
            </div>
        </div>
        
    </div>
</template>

<script>
export default {
    data(){
        return{
            sub:''
        }
    },
    mounted(){
         const id = this.$route.params.id;
            let subList =[
                {label:'语文',value:1},
                {label:'数学',value:2},
                {label:'化学',value:3},
                {label:'英语',value:4},
                {label:'物理',value:5},
                {label:'生物',value:6}
            ];
            subList.forEach((item)=>{
                if(item.value == id){
                 return  this.sub = item.label;
                }
            })
    }
}
</script>


<style lang='scss' scoped>
.subpage{
    .banner{
        width: 100%;
        height: 360px;
        background: url('/static/image/bannerpic.png') no-repeat;
        background-size:100% 100%;
        background-position: center; 
    }
    .subjectinfo{
        width: 1200px;
        margin: 0 auto;
        background-color: #ca0000;
        padding: 10px;
        min-height: 500px;
        display: flex;
        margin-top: 20px;
        margin-bottom: 20px;
        .userinfo{
            width: 200px;
            height: 100%;
            .userul{
                width: 100%;
                color: #fff;
                padding-left: 20px;
                padding-top: 20px;
                li{
                    height: 45px;
                    .text2{text-indent: 2em;line-height: 30px;}
                }
            }
            .el-menu-item.is-active {
                 background-color: #fff !important;
            }
        }
        .subinfo{
            flex: 1;
            height: 100%;
            background-color: #fff;
            padding: 10px;
            .back{
                width: 100%;
                text-align: right;
                color:#ca0000;
                cursor: pointer;
            }
            .subbox{
                width: 100%;
                .page{
                    width: 100%;
                    text-align: center;
                }
            }
        }

    }
}

  .subbox ul {
      width: 100%;
      box-sizing: border-box;
      padding: 10px;
  }
  .subbox{
    width: 100%;
    box-sizing: border-box;
  }
  .subbox li {
    box-sizing: border-box;
    width: 40%;
    min-height: 200px;
    padding: 10PX;
    float: left;
    margin-left: 15px;
    margin-right: 15px;
    margin-bottom: 30px;
    text-align: left;
    cursor: pointer;
    img{
        width: 100%;
        height:200px;
        display: block;
    }
    .teacher{width:100%;text-align: center;line-height: 36px;font-weight: 500;color:#000000;font-size: 18px;margin-top: 20px;}
  }
</style>